package com.dxx.cloud.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dxx.cloud.admin.module.entity.GoodsEntity;
import com.dxx.cloud.admin.module.request.GoodsAddRequest;
import com.dxx.cloud.admin.module.request.GoodsInventoryChangeAddModule;
import com.dxx.cloud.admin.module.request.GoodsListRequest;
import com.dxx.cloud.admin.module.request.GoodsNumberRequest;
import com.dxx.cloud.admin.module.response.GoodsNumberResponse;

import java.util.List;

/**
 * <p>
 * 商品 Mapper 接口
 * </p>
 *
 * @author dh
 * @since 2025-06-06
 */
public interface GoodsMapper extends BaseMapper<GoodsEntity> {
    /**
     * 查询最大序号
     * @param request
     * @return
     * @throws Exception
     */
    GoodsEntity selectMaxOrderNo(GoodsAddRequest request);

    /**
     * 商品类别下的商品数量
     * @param request
     * @return
     * @throws Exception
     */
    List<GoodsNumberResponse> goodsNumber(GoodsNumberRequest request);

    /**
     * 根据商品名称模糊搜素
     * @param request
     * @return
     * @throws Exception
     */
    List<GoodsEntity> listWithNameLike(GoodsListRequest request) ;

    /**
     *
     * @param module
     * @return
     * @throws Exception
     */
    GoodsEntity selectByNameAndType(GoodsInventoryChangeAddModule module);
}
